package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.YmtCouponSellerPrefix;
import com.ymttest.utils.EnvSetup;

public class YmtCouponSellerPrefixWapper {
	SqlManager manage;

	public YmtCouponSellerPrefixWapper() {
		manage = new SqlManager("ymt" + EnvSetup.getEnv());
	}
	
	public void updateIsOpen(String batchCode) {
		int i=manage.update(
						"com.ymttest.database.mapping.YmtCouponSellerPrefixMapper.updateIsOpen",
						batchCode);
		manage.commit();
	}
	
	public void updateIsOpen(String batchCode, boolean status) {
		Map m = new HashMap();
		m.put("batchCode", batchCode);
		m.put("status", status);
		int i=manage.update(
						"com.ymttest.database.mapping.YmtCouponSellerPrefixMapper.updateIsOpenStatus",
						m);
		manage.commit();
	}
	
	public List<YmtCouponSellerPrefix> selectBysBatchCode(String sBatchCode) {
		List<YmtCouponSellerPrefix> result = manage
				.getSelectResults(
						"com.ymttest.database.mapping.YmtCouponSellerPrefixMapper.selectBySBatchCode",
						sBatchCode);
		manage.commit();
		return result;
	}
	
	public void updateAllIsOpenForiOperatorid(int iOperatorid)
	{
		int i=manage.update(
				"com.ymttest.database.mapping.YmtCouponSellerPrefixMapper.updateAllIsOpenForiOperatorid",
				iOperatorid);
		manage.commit();
	}
}
